package com.getui.java.advancedpushmessage;

import java.util.ArrayList;
import java.util.List;

import com.getui.java.COMM;
import com.gexin.rp.sdk.base.IAliasResult;
import com.gexin.rp.sdk.base.impl.Target;
import com.gexin.rp.sdk.http.IGtPush;

/**
 * 注：只要有一个cid绑定成功，getResult返回结果就为true
 */
public class AliasFunction1 {

	public static void main(String[] args) {
		List<Target> Lcids = new ArrayList<Target>();
		Target target1 = new Target();
		Target target2 = new Target();
		target1.setClientId("e605a0db5ce3cca9b76b012978064940");
		target1.setAlias("个推1");
		target2.setClientId("23170b169630706f82baf94c8a2b8923");
		target2.setAlias("个推2");
		Lcids.add(target1);
		Lcids.add(target2);
		IGtPush push = new IGtPush(COMM.host, COMM.appKey, COMM.masterSecret);
		IAliasResult bindLCid = push.bindAlias(COMM.appId, Lcids);
		System.out.println(bindLCid.getResult());
		System.out.println(bindLCid.getErrorMsg());
		// 10004|0b8baad8-455c-4c59-b317-f125b530f3ac|aliaslist is invalid
	}
}
